<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<!--Converted with LaTeX2HTML 96.1 (Feb 5, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->


<title>Ugly Numbers</title>
<meta name="description" content="Ugly Numbers">
<meta name="keywords" content="htmlatex">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<link rel="STYLESHEET" href="acm-00136_archivos/htmlatex.css">
</head><body bgcolor="#ffffff" lang="EN">
 <h1><br clear="all"><center><table bgcolor="#0060f0"><tbody><tr><td><b><font color="#c0ffff" size="5">&nbsp;<a name="SECTION0001000000000000000000">Ugly Numbers</a></font>&nbsp;</b></td></tr></tbody></table></center></h1>
<p>
Ugly numbers are numbers whose only prime factors are 2, 3 or 5.  The sequence
</p><p>
</p><p>
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...
</p><p>
</p><p>
</p><p>
shows the first 11 ugly numbers.  By convention, 1 is included.
</p><p>
</p><p>
Write a program to find and print the 1500'th ugly number.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001001000000000000000">Input and Output</a></font></h2>
<p>
There is no
input to this program.  Output should consist of a single line as
shown below, with &lt;number&gt; replaced by the number computed.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001002000000000000000">Sample output</a></font></h2>
<p>
<tt>The 1500'th ugly number is &lt;number&gt;.</tt>
</p><p>
</p></body></html>